package semantic.rules.walk

import syntax.CGrammar._
import syntax.{CCategory, CASTNode}
import utils.data.CTree
import scala.collection.mutable.Buffer
import semantic.COperations._

object CWalkRuleFunctionCall extends CWalkRule
{
    override val categories:Seq[CCategory] = CFunctionCall :: Nil

    override def post(node:CASTNode)(implicit tree:CTree[CASTNode], code:Buffer[String]) =
        code += s"""$PUSH "${node().firstChild().value}"""" += GET_VAR += CALL
}
